.html-block {
  position: absolute;
  height: 100%;
  width: 100%;
}
.player-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

/* ─── Logo ─── */
.logo {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  padding: 6px 13px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 1;
  transition: opacity 0.4s;
}
.logo img {
  width: 100%;
  height: 15px;
}
/* ─── Overlay gradient ─── */
.controls-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 60px 20px 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, transparent 100%);
  transition: opacity 0.4s ease;
}

.player-wrapper:not(.paused):not(:hover) .controls-overlay {
  opacity: 0;
}
.player-wrapper:not(.paused):not(:hover) .logo {
  opacity: 0;
}

/* ─── Progress ─── */
.progress-area {
  position: relative;
  width: 100%;
  height: 4px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: all 0.1s;
}
.progress-area:hover {
  height: 6px;
}
.progress-area:hover .progress-thumb {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.progress-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  transition: height 0.2s;
}
.progress-buffer {
  position: absolute;
  height: 100%;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  width: 0%;
  transition: width 0.5s;
}
.progress-fill {
  position: absolute;
  height: 100%;
  background: linear-gradient(90deg, #a78bfa, #7c3aed);
  border-radius: 10px;
  width: 0%;
  transition: width 0.1s linear;
}
.progress-thumb {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 14px;
  height: 14px;
  background: #a78bfa;
  border-radius: 50%;
  margin-left: -7px;
  box-shadow: 0 0 8px #7c3aed;
  opacity: 0;
  transition:
    opacity 0.2s,
    transform 0.2s;
  pointer-events: none;
}

/* ─── Controls row ─── */
.controls-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ─── Buttons ─── */
.ctrl-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 7px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition:
    background 0.2s,
    transform 0.15s;
  position: relative;
}
.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.12);
}
.ctrl-btn:active {
  transform: scale(0.95);
}
.ctrl-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* play/pause bigger */
.btn-play svg {
  width: 24px;
  height: 24px;
}

/* ─── Time ─── */
.time-display {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12.5px;
  white-space: nowrap;
  margin: 0 4px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}
.time-display span {
  color: rgba(255, 255, 255, 0.45);
  margin: 0 2px;
}

/* ─── Spacer ─── */
.spacer {
  flex: 1;
}

/* ─── Volume area ─── */
.volume-area {
  position: relative;
  display: flex;
  align-items: center;
}
.volume-slider-wrap {
  overflow: hidden;
  width: 0;
  opacity: 0;
  transition:
    width 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.35s ease;
  display: flex;
  align-items: center;
}
.volume-area:hover .volume-slider-wrap,
.volume-area:focus-within .volume-slider-wrap {
  width: 80px;
  opacity: 1;
}
.volume-slider {
  -webkit-appearance: none;
  width: 72px;
  height: 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.25);
  outline: none;
  cursor: pointer;
  margin-left: 6px;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #a78bfa;
  box-shadow: 0 0 6px #7c3aed;
  cursor: pointer;
  transition: transform 0.15s;
}
.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

/* ─── Speed ─── */
.speed-wrap {
  position: relative;
}
.speed-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 9px;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.15s;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.speed-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.07);
}

.speed-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) scaleY(0);
  transform-origin: bottom center;
  background: rgba(18, 18, 28, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px 0;
  min-width: 90px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition:
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.25s ease;
  z-index: 20;
}
.speed-wrap.open .speed-menu {
  transform: translateX(-50%) scaleY(1);
  opacity: 1;
}
.speed-menu button {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  padding: 8px 16px;
  cursor: pointer;
  text-align: center;
  transition:
    background 0.15s,
    color 0.15s;
  border-radius: 6px;
}
.speed-menu button:hover {
  background: rgba(167, 139, 250, 0.2);
  color: #fff;
}
.speed-menu button.active {
  color: #a78bfa;
  font-weight: 700;
}

/* ─── Tooltip ─── */
.ctrl-btn::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 18, 28, 0.9);
  color: #fff;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 7px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.ctrl-btn:hover::after {
  opacity: 1;
}

/* ─── Fullscreen ─── */
.player-wrapper:-webkit-full-screen {
  width: 100%;
  border-radius: 0;
}
.player-wrapper:fullscreen {
  width: 100%;
  border-radius: 0;
}
.player-wrapper:-webkit-full-screen #video {
  height: 100vh;
  aspect-ratio: unset;
}
.player-wrapper:fullscreen #video {
  height: 100vh;
  aspect-ratio: unset;
}
:not(:root):fullscreen video::backdrop {
  position: fixed;
  inset: 0px;
  background: black;
}

/* ─── Responsive ─── */

@media screen and (max-width: 600px) {
  .logo img {
    height: 8px;
  }
  .controls-row button svg {
    width: 14px;
    height: 14px;
  }
  .volume-slider-wrap {
    display: none;
  }
  .time-display {
    font-size: 8px;
  }
  button#speedBtn {
    font-size: 7px;
    width: 28px;
    height: 28px;
  }
  button#fsBtn svg {
    width: 14px;
    height: 14px;
  }
  .ctrl-btn::after {
    font-size: 6px;
  }
  .speed-menu button {
    font-size: 7px;
    padding: 5px 4px;
  }
}
